<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
		<link rel="stylesheet" type="text/css" href="../bootstrap-3.3.7/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/flatpickr.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/font-awesome.css"/>
		<link rel="stylesheet" type="text/css" href="../dialog/css/dialog.css"/>
		<link rel="stylesheet" href="../css/shoufengqin.css">
		<link rel="stylesheet" type="text/css" href="../css/haha.css" media="screen" />


		<script src="../js/jquery-1.9.1.min.js" type="text/javascript" ></script>
		<script src="../js/google-maps.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../dialog/js/dialog.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/jquery.form.js"></script>
		<script src="../js/common.js"></script>
		<script src="../js/flatpickr.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/messages_zh.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/shoufengqin.js"></script>
		<script src="../laydate/laydate.js"></script> <!-- 改成你的路径 -->

	</head>

	<body>
		<!--顶部导航 -->
		<nav class="topNavItemBox">
			<div id="ItemBox">
				<div class="title">智慧溯源系统</div>
				<div class="subtitle">肉品溯源管理</div>
				<div class="rightUserInfo">
					<div class="commentAvatarDiv">
						<img class="commentAvatarImage" src="../images/123.png">
					</div>
					<div class="userName">Jason Wong</div>
					<span class="glyphicon glyphicon-option-vertical userIcon" aria-hidden="true"></span>
				</div>
			</div>
		</nav>
		<div class="contain">
			<!-- 左侧导航 -->
			<div class="left1">
				<div class="list22">
					<ul>
						<li>
							<p class="title22">Item1</p>
							<ul class='list-se'>
								<p class="title22">Item1</p>
								<li><p>li-1</p></li>
							</ul>
						</li>
						<li>
							<p class="title22">Item2</p>
							<ul class='list-se'>
								<p class="title22">Item2</p>
								<li><p>li-1</p></li>
								<li><p>li-2</p></li>
								<li><p>li-3</p></li>
								<li><p>li-4</p></li>
								<li><p>li-5</p></li>
								<li><p>li-6</p></li>
							</ul>
						</li>
						<li>
							<p class="title22">Item3</p>
							<ul class='list-se'>
								<p class="title22">Item3</p>
								<li><p>li-1</p></li>
								<li><p>li-2</p></li>
								<li><p>li-3</p></li>
							</ul>
						</li>
						<li>
							<p class="title22">Item4</p>
							<ul class='list-se'>
								<p class="title22">Item4</p>
								<li><p>li-1</p></li>
								<li><p>li-2</p></li>
								<li><p>li-3</p></li>
							</ul>

						</li>
						<li>
							<p class="title22">foot5</p>
						</li>
					</ul>
				</div>
			</div>
			<!-- 新增疫苗入库信息 -->
			<div id="middle1" class="page_main">
				<div id="middle2" class="page_content"> 
				<!-- <h3>新增饲料信息</h3><span class="add_link"><a href="feeds_manage.ftl">查询饲料信息></a></span>
				<br /> -->
				<div class="add_title">
					<div class="second_title_main">新增疫苗入库信息</div>
					<div class="second_title_main_bread"> > 疫苗入库 > 物资</div>
				</div>
					<form id="feeds_addform" action="FeedsAction_addFeed" method="post">
						<ul>
							<li><label class="labelBeforinput">名称</label><select name="gid"  class="bigInputtext" required data-rule-notZero="true">
									<option value="0">请选择名称</option>
								</select>
							</li>
							<li><label class="labelBeforinput">入库数量</label><input name="component"  class="bigInputtext" required type="text"></li>
							<li><label class="labelBeforinput">入库单位</label><input name="component"  class="bigInputtext" required type="text"></li>
							<li><label class="labelBeforinput">入库日期</label><input name="component"  class="bigInputtext" required type="text" id="test1" style="width: 260px;"></li>
							<li><label class="labelBeforinput">生产日期</label><input name="component"  class="bigInputtext" required type="text" id="test2" style="width: 260px;"></li>
							<li><label class="labelBeforinput">过期日期</label><input name="component"  class="bigInputtext" required type="text" id="test3" style="width: 260px;"></li>
							<li><label class="labelBeforinput">价格</label><span class="label_small_title">单价</span><input name="component"  class="bigInputtext_small" required type="text"><span class="label_small_title">总价</span><input name="component"  class="bigInputtext_small" required type="text"><span class="label_small_title">折扣</span><input name="component"  class="bigInputtext_small" required type="text"><span class="label_middle_title">最终计价</span><input name="component"  class="bigInputtext_small" required type="text"></li>
							
						<!-- 	<li><label class="labelBeforinput">供应商ID(下拉)</label><input name="gid"  class="bigInputtext" required type="text"  data-date-format="Y-m-d"/></li> -->
							<li><label class="labelBeforinput">备注</label><input name="remark" class="bigInputtext"  type="text" /></li>
					
							<li><input type="submit" value="确认" style="margin-left:50px;width: 100px;background-color: #00BFFF;" /></li>
						</ul>
					</form>
				
				</div>
			</div>
		</div>
		<div class="footer">
				<div class="footer_lineone">
					<span id="logo"></span>肉品溯源管理系统 
					<span class="footer_lineoneSpan"><a href="aboutus.html">关于我们</a></span>
					<span class="footer_lineoneSpan"><a target="_blank" href="http://www.cfsiw.com/">食品安全信息</a></span> 
					<span class="footer_lineoneSpan"><a href="suggestionAdd.ftl">联系我们</a></span>
				</div>
				<div class="footer_linetwo">
					 &copy;2017广东技术师范学院
				</div>
			</div>
	</body>
	<script>
		$(function() {
			//初始化侧边栏
			$(".vertical-nav").verticalnav({
				speed: 400,
				align: "left"
			});
			
			//时间选择组件
			laydate.render({
			  elem: '#test1' //指定元素
			});
			laydate.render({
			  elem: '#test2' //指定元素
			});
			laydate.render({
			  elem: '#test3' //指定元素
			});

			//时间控制器
			$("#beginTime").flatpickr();
			$("#endTime").flatpickr();
			$("#inTime").flatpickr();
			//表单校验
			$("#quarantine_addform").validate();
			//异步下拉
			$.post("FeedsAction_findCompByType", function(data) {
				//$("select[name='gid']").empty();
				console.log(data);
				for(var i = 0; i < data.length; i++) {
					$("select[name='gid']").append("<option value='" + data[i].gid + "'>" + data[i].compName + "</option>");
					}
			});	
			//表单提交
			$("#quarantine_addform").ajaxForm({
					/* error: function(XMLHttpRequest, textStatus, errorThrown){
						//失败
						$.dialog({
							type: 'info',
							contentHtml: '<img class="info-icon" src="dialog/images/icon/fail.png" alt="增加失败" /><p class="info-text">请输入正确的生猪编号</p>',
							autoClose: 2000
						});
					}, */
					success:function(data) {
						var str = null;
						var msg = null;
						if(data.msg == 1){
							str = "success";
							msg = "添加成功"
						}else{
							str = "fail";
							msg = "添加失败，请输入选择正确的疫苗";
						}
						console.log(data);
						$.dialog({
							type: 'info',
							contentHtml: '<img class="info-icon" src="dialog/images/icon/'+str+'.png" alt="'+msg+'" /><p class="info-text">'+
msg+'</p>',
							autoClose: 2000
						});
					}
			});
		});


		jQuery(document).ready(function($) 
				{
					$('.list22 ul li p').clickdown();
					$('.list-se p[class=title22]').clickup();
					$('.list22>ul>li').ad();
				});

	</script>

</html>